package com.example.graduatetest.activitys;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProviders;

import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.widget.Toast;

import com.baidu.geofence.GeoFence;
import com.baidu.geofence.GeoFenceClient;
import com.baidu.geofence.GeoFenceListener;
import com.baidu.geofence.model.DPoint;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.mapapi.CoordType;
import com.baidu.mapapi.SDKInitializer;
import com.baidu.mapapi.map.CircleOptions;
import com.baidu.mapapi.map.DotOptions;
import com.baidu.mapapi.map.MapStatus;
import com.baidu.mapapi.map.MapStatusUpdateFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.MyLocationData;
import com.baidu.mapapi.map.OverlayOptions;
import com.baidu.mapapi.map.Stroke;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.utils.DistanceUtil;
import com.example.graduatetest.R;
import com.example.graduatetest.bean.Classes;
import com.example.graduatetest.databinding.ActivityFindCardBinding;
import com.example.graduatetest.view.model.AddClassViewModel;
import com.example.graduatetest.view.model.FindCardViewModel;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class FindCardActivity extends AppCompatActivity{
    private ActivityFindCardBinding binding;
    private FindCardViewModel findCardViewModel;



    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_find_card);

        //隐藏ActionBar
        if(getSupportActionBar() != null){
            ActionBar actionBar = getSupportActionBar();
            actionBar.hide();
        }

        //在使用SDK各组件之前初始化context信息，传入ApplicationContext
        SDKInitializer.initialize(getApplicationContext());

        //自4.3.0起，百度地图SDK所有接口均支持百度坐标和国测局坐标，用此方法设置您使用的坐标类型.
        //包括BD09LL和GCJ02两种坐标，默认是BD09LL坐标。
        SDKInitializer.setCoordType(CoordType.BD09LL);

        binding = DataBindingUtil.setContentView(this,R.layout.activity_find_card);

        //接受Intent传来的数据
        Intent intent = getIntent();
        String class_id = intent.getStringExtra("class_number");

        //LiveData
        findCardViewModel = ViewModelProviders.of(this).get(FindCardViewModel.class);
        binding.setFindCardViewModel(findCardViewModel);
        binding.setLifecycleOwner(this);
        findCardViewModel.init(this,binding,class_id);

    }


}



